package login;

import java.time.LocalTime;

public class Order {

    private String oId;
    private LocalTime oTime;
    private vegetableList dishes;
    private int oNumber;
    private Double discount;//优惠券
    private Double tolPrice;
    private User ctm;
    private String status;
    private User slr;


    public Order() {
        this.discount=0.0;
        this.oNumber=0;
        this.tolPrice=0.0;
        this.status="未确认";

    }

    //全参构造
    public Order(String oId, LocalTime oTime, vegetableList dishes, int oNumber, Double discount, Double tolPrice, User ctm, String status, User slr) {
        this.oId = oId;
        this.oTime = oTime;
        this.dishes = dishes;
        this.oNumber = oNumber;
        this.discount = discount;
        this.tolPrice = tolPrice;
        this.ctm = ctm;
        this.status = status;
        this.slr = slr;
    }

    public Order(String oId, LocalTime oTime, vegetableList dishes, int oNumber, Double tolPrice, User ctm, User slr, String status) {
        this.dishes = dishes;
        this.oNumber = oNumber;
        this.discount = discount;
        this.tolPrice = tolPrice;
        this.ctm = ctm;
        this.slr = slr;
        this.oId = oId;
    }


    @Override//重写菜单方法
    public String toString() {
        return "Order[ID="+oId+" 菜品:"+dishes.getDame()+" 数目："+oNumber+" 金额："+tolPrice+"订单状态："+status+"下单时间："+oTime+"]\n"+
                "   商家id："+slr.getuID()+"  商家名称:" +slr.getUsername()+
                "   买家id："+ctm.getuID()+"  买家名称:" +ctm.getUsername()+"\n";
    }

    public void setoTime(LocalTime oTime) {
        this.oTime = oTime;
    }
    public LocalTime getoTime() {
        return oTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }





    public String getoId() {
        return oId;
    }

    public void setoId(String oId) {
        this.oId = oId;
    }

    public vegetableList getDishes() {
        return dishes;
    }

    public void setDishes(vegetableList dishes) {
        this.dishes = dishes;
    }

    public int getoNumber() {
        return oNumber;
    }

    public void setoNumber(int oNumber) {
        this.oNumber = oNumber;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Double getTolPrice() {
        return tolPrice;
    }

    public void setTolPrice(Double tolPrice) {
        this.tolPrice = tolPrice;
    }


    public User getCtm() {
        return ctm;
    }

    public void setCtm(User ctm) {
        this.ctm = ctm;
    }

    public void setSlr(User slr) {
        this.slr = slr;
    }

    public User getSlr() {
        return slr;
    }

}
